package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.common.vo.Result;
import com.itheima.model.OrderInfo;
import com.itheima.service.OrderService;
import org.apache.ibatis.annotations.Insert;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("order")
public class OrderController {

    @Reference(version = "1.0")
    private OrderService orderService;

    ///order/send.do?telephone

    @GetMapping("send")
    public Result send(String telephone) {
        return orderService.send(telephone);
    }

    @PostMapping("submit")
    public Result submit(@RequestBody OrderInfo orderInfo) {
        return orderService.submit(orderInfo);
    }
    ///order/findById.do?id=" + id
    @PostMapping("findById")
    public Result findById(Integer id) {
        return orderService.findById(id);
    }
}
